<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <p></p>
    <p></p>
    <p></p>

    <script>

        // __proto__ 这个属性  也是可读可写的   可以改变    --- 但作用有限 


        const oPs = document.querySelectorAll('p');
        console.log(oPs)   // NodeList   forEach


        const oPs2 = document.getElementsByTagName('p');
        console.log(oPs2)   // HTMLCollection   没有forEach


        const len = oPs2.length;


        // 原型指向改变之后  --- length没了
        oPs2.__proto__ = Array.prototype;

        console.log(oPs2)


        oPs2.length = len;


        oPs2.forEach(v => {
            console.log(v)
        })




    </script>

</body>

</html>